local open_beta=GLOBAL.aipGetModConfig("open_beta")



function ShadowFollowerPrefabPostInit(inst)
if not GLOBAL.TheWorld.ismastersim then
return
end

if not inst.components.shadow_follower then
inst:AddComponent("shadow_follower")
end
end

AddPrefabPostInit("dragonfly",function(inst) ShadowFollowerPrefabPostInit(inst) end)
AddPrefabPostInit("deerclops",function(inst) ShadowFollowerPrefabPostInit(inst) end)
AddPrefabPostInit("bearger",function(inst) ShadowFollowerPrefabPostInit(inst) end)
AddPrefabPostInit("moose",function(inst) ShadowFollowerPrefabPostInit(inst) end)
AddPrefabPostInit("beequeen",function(inst) ShadowFollowerPrefabPostInit(inst) end)
AddPrefabPostInit("klaus",function(inst) ShadowFollowerPrefabPostInit(inst) end)
AddPrefabPostInit("klaus_sack",function(inst) ShadowFollowerPrefabPostInit(inst) end)
AddPrefabPostInit("antlion",function(inst) ShadowFollowerPrefabPostInit(inst) end)
AddPrefabPostInit("toadstool",function(inst) ShadowFollowerPrefabPostInit(inst) end)
AddPrefabPostInit("toadstool_dark",function(inst) ShadowFollowerPrefabPostInit(inst) end)
AddPrefabPostInit("crabking",function(inst) ShadowFollowerPrefabPostInit(inst) end)
AddPrefabPostInit("hermithouse",function(inst) ShadowFollowerPrefabPostInit(inst) end)
AddPrefabPostInit("malbatross",function(inst) ShadowFollowerPrefabPostInit(inst) end)




local birds={ "crow","robin","robin_winter","canary","quagmire_pigeon","puffin" }
for i,name in ipairs(birds) do
AddPrefabPostInit(name,function(inst)
if open_beta~="open" then
return nil
end

if inst.components.periodicspawner~=nil then

inst.components.periodicspawner.randtime=inst.components.periodicspawner.randtime*0.9

local originPrefab=inst.components.periodicspawner.prefab


inst.components.periodicspawner.prefab=function(inst)
local prefab=originPrefab
if type(originPrefab)=="function" then
prefab=originPrefab(inst)
end

if prefab=="seeds" and math.random() < .1 then
return "aip_leaf_note"
end

return prefab
end
end
end)
end


AddPrefabPostInit("livinglog",function(inst)

inst:AddTag("LIVINGLOG_fuel")
end)